export default {
  state: () => ({
    flag: 1
  }),
  mutations: {
    changeFlag(state, n) {
      state.flag = n
    }
  },
  actions: {
    // commit, state
    setFlag({commit}, n) {
      commit('changeFlag', n)
    }
  },
  getters: {
    // getters, rootState)
    flagToName (state) {
      return state.flag ? '普通用户' : '代理'
    }
  },
  namespaced: true 
}